package de.mindshareprojects.datawarehouse.server;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class TemplateDownload extends HttpServlet {

	public void doPost(HttpServletRequest request, HttpServletResponse response)
	throws IOException {
		
		doGet(request, response);
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {

		PrintWriter out = response.getWriter();
		response.setContentType("application/vnd.ms-excel");
		response.setHeader("content-disposition","attachment; filename=UnileverWebtrendsInputTemplate.xls"); 

		String head="<table><tr>" +
				"<td>CampaignID</td>" +
				"<td>Description</td>" +
				"<td>Creative</td>" +
				"<td>Creative Type</td>" +
				"<td>Demand Channel</td>" +
				"<td>Marketing Activity</td>" +
				"<td>Marketing Program</td>" +
				"<td>Offer</td>" +
				"<td>Partner</td>" +
				"<td>Placement</td>" +
				"<td>ZielURL</td>" +
				"</tr></table>";
		out.print(head);
	}
}
